const backendOrigin = process.env.VUE_APP_BACKEND_ORIGIN || 'http://192.168.58.197d :8080';

export default function resolveImageUrl(url) {
  if (!url) return '';
  // 如果url是localhost，强制替换为服务器IP
  if (url.startsWith('http://localhost:8080')) {
    return url.replace('http://localhost:8080', backendOrigin);
  }
  if (url.startsWith('http')) return url;
  return backendOrigin + url;
}